// navigator.userLanguage for IE, navigator.language for others 
	//var lang = navigator.language || navigator.userLanguage;


function deleteRow(tableID, selectedRowIndex, lang, message) {
	try {
		var table = document.getElementById(tableID);
		table.deleteRow(selectedRowIndex);
		var rowCount = table.rows.length;
		for(var i =selectedRowIndex; i < rowCount; i++){
			//setting names
			if(lang == "ar"){
				document.getElementById("documents" + i + ".documentType.arabicName").name = "documents[" + (i-1) + "].documentType.arabicName";
			}else{
				document.getElementById("documents" + i + ".documentType.englishName").name = "documents[" + (i-1) + "].documentType.englishName";
			}
			
			document.getElementById("documents" + i + ".documentType.id").name = "documents[" + (i-1) + "].documentType.id";
			document.getElementById("multipartFiles" + i).name = "multipartFiles[" + (i-1) + "]";
			
			//setting ids
			if(lang == "ar"){
				document.getElementById("documents" + i + ".documentType.arabicName").id = "documents" + (i-1) + ".documentType.arabicName";
			}else{
				document.getElementById("documents" + i + ".documentType.englishName").id = "documents" + (i-1) + ".documentType.englishName";
			}
			document.getElementById("documents" + i + ".documentType.id").id = "documents" + (i-1) + ".documentType.id";
			document.getElementById("multipartFiles" + i).id = "multipartFiles" + (i-1);
		}
		jAlert(message, '');
	} catch (e) {
		alert(e);
	}
}

